//输入一个矩阵，按照从外向里以顺时针的顺序依次打印出每一个数字，例如，如果输入如下矩阵： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10.
class Solution {
public:
    vector<int> printMatrix(vector<vector<int> > matrix) {
    	vector<int> result;
    	int cols = matrix[0].size(), rows = matrix.size();

    	if(cols == 0 || rows == 0)
    		return result;
    	int start = 0;
    	while(cols > 2*start && rows > 2*start)
    	{
    		printCircle(matrix,start,result);
    		++start;
    	}
    	return result;
    }

   	void printCircle(const vector<vector<int>> &matrix,int start,vector<int> &result)
   	{
   		int endX = matrix[0].size() - 1 - start;
   		int endY = matrix.size() - 1 - start;
   		
   		for(int i = start; i <= endX; ++i)
   			result.push_back(matrix[start][i]);
   		if(start <endY)
   			for(int i = start +1 ; i <= endY ; ++i)
   				result.push_back(matrix[i][endX]);
   		if(start < endX && start<endY)
   			for(int i = endX - 1 ; i>=start ; --i)
	   			result.push_back(matrix[endY][i]);
   		if(start < endX && start < endY-1)
   			for(int i = endY - 1 ; i >=start +1 ; --i)
   				result.push_back(matrix[i][start]);
   	}

};
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
	cout<<ceil(2.3)<<endl;
}